import request from '@/utils/request'

// 区域树接口
export function fetchTree() {
  return request({
    url: '/api/admin/region/tree',
    method: 'get'
  });
}

export function getList(query) {
  return request({
    url: '/api/admin/register/page',
    method: 'get',
    params: query
  })
}

export function auditPass() {
  return request({
    url: '/api/admin/register/'
  })
}

export function singlePass(user) {
  return request({
    url: 'api/admin/register/singlePass',
    method: 'post',
    data: user
  })
}

export function singleReject(user) {
  return request({
    url: 'api/admin/register/singleReject',
    method: 'post',
    data: user
  })
}

export function getObj(id) {
  return request({
    url: 'api/admin/register/' + id,
    method: 'get'
  })
}

export function addObj(obj) {
  return request({
    url: 'api/admin/register',
    method: 'post',
    data: obj
  })
}

export function getTenantList() {
  return request({
    url: 'api/admin/tenant/all',
    method: 'get'

  })
}

export function getStreets(tenantId) {
  return request({
    url: 'api/admin/region/registerStreet',
    method: 'get',
    params: { tenantId }
  })
}

export function getCommunitys(streetId, tenantId) {
  return request({
    url: 'api/admin/region/registerCommunitys',
    method: 'get',
    params: { streetId, tenantId }
  })
}

export function putObj(id, obj) {
  return request({
    url: 'api/admin/register/' + id,
    method: 'put',
    data: obj
  })
}

export function passAll(obj) {
  return request({
    url: 'api/admin/register/passAll',
    method: 'POST',
    data: obj
  })
}

export function rejectAll(obj) {
  return request({
    url: 'api/admin/register/passAll',
    method: 'POST',
    data: obj
  })
}



